#include"Heap.h"
void HeapSort(HPDataType* a, int n)//堆排序
{
	//建堆
	for (int i = (n - 1 - 1) / 2; i>=0; i--)
	{
		AdJustDown(a, n, i);
	}
	int end = n - 1;
	while (end>0)
	{
		Swap(&a[0], &a[end]);
		AdJustDown(a, end, 0);
		end--;
	}
}
int main()
{
	Heap hp;
	int a[] = { 27,15,19,18,28,34,65,49,25,37 };
	int n = sizeof(a) / sizeof(a[0]);
	//HeapSort(a, n);//堆排序
	/*AdJustDown(a, n, 0);*/
	HeapInit(&hp,a,n);
	HeapPush(&hp, 13);
	HeapPop(&hp);
	HeapDestroy(&hp);
	return 0;
}